/*
    GPL v3 Licence :
    Bombersow is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    Bombersow is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with Bombersow.  If not, see <http://www.gnu.org/licenses/>.


    Creative Commons BY-NC-SA :
    This work is licensed under the Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License.
    To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/3.0/ or send a letter
    to Creative Commons, 171 Second Street, Suite 300, San Francisco, California, 94105, USA.

*/

#ifndef AUDIOENGINE_H
#define AUDIOENGINE_H

typedef struct AUDIO_ENGINE_SOUND
{
    struct AUDIO_ENGINE_SOUND* prev;

    sfSound* sound;

    struct AUDIO_ENGINE_SOUND* next;
} AudioEngineSound;

typedef struct
{
    sfThread* update_thread;

    sfSoundBuffer** soundbuffers;
    unsigned int nb_soundbuffers;

    AudioEngineSound* sounds;

    sfMusic** musics;
    unsigned int nb_musics;

    sfBool started;
} AudioEngine;

AudioEngine* AudioEngine_Init();
void AudioEngine_Destroy(AudioEngine* engine);
void AudioEngine_UpdateEngine(void* UserData);
void AudioEngine_LoadSound(AudioEngine* engine, char* path);
void AudioEngine_LoadMusic(AudioEngine* engine, char* path);
void AudioEngine_PlaySound(AudioEngine* engine, int index);

#endif
